﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<logic:present name="user_session" scope="session">
<html:form action="/answertech" enctype="multipart/form-data" focus="content" onsubmit="return validate(this);" target="_top">
<html:hidden property="action" value="modify"/>
<html:hidden property="page"/>
<html:hidden property="pageSize"/>
<input type="hidden" name="id" value="<bean:write name="answero" property="id"/>"/>
<table align="center" width="100%" cellpadding="0" cellspacing="0">
   <tr>
        <td align="right" width="150">内容:</td>
        <td>
            <html:textarea property="content" name="answero" cols="75" rows="10"/>
        </td>
    </tr>
   <tr>
        <td align="right">参考:</td>
        <td>
            <html:text property="reference"  name="answero" size="90" maxlength="60"/>(http://开始)
        </td>
    </tr>
    <tr>
        <td align="right">图片:</td>
        <td>
            <iframe name="ad1" frameborder="0" width="100%" height="25" scrolling="no" src="/question.mrqa?action=uploadImage&imageIn=questionMod&imageArea=answer.content"></iframe>
        </td>
    </tr>
   <tr>
        <td align="right">&nbsp;</td>
        <td>
            <input type="submit" value="提交修改"/>
        </td>
    </tr>
    </html:form>
</table>
</logic:present>
<script type="text/javascript">
    function validate(pForm)
    {
        var content = pForm.content.value;
        if(content == "" || content.length < 1)
        {
            alert("[内容]必须填写，长度必须大于0");
            pForm.content.focus();
            return false;
        }
        var uploadImage = frames["ad1"].window.document.getElementById("uploadButton");
        if(uploadImage){
    			uploadImage.disabled = true;
    		}
        return true;
    }
    function cancelAdd()
    {
        history.back(1);
    }    
</script>    